package com.yaozheng.vocationaltraining.dialog;

import org.androidannotations.annotations.UiThread;

import net.sf.json.JSONObject;
import android.content.Context;
import android.view.Gravity;

import com.yaozheng.vocationaltraining.R;
import com.yaozheng.vocationaltraining.fragment.HomeFragment;
import com.yaozheng.vocationaltraining.iview.IHomeSignTaskView;
import com.yaozheng.vocationaltraining.view.HomeSignTaskView;
import com.yaozheng.vocationaltraining.view.HomeSignTaskView_;

/**
 * 主页签到任务对话框
 * 
 * @author Administrator
 * 
 */
public class HomeSignTaskDialog extends BaseDialog {
	HomeFragment homeFragment;

	HomeSignTaskView homeSignTaskView;

	public HomeSignTaskDialog(Context context, HomeFragment homeFragment) {
		super(context, R.style.baseDialogStyleTheme, true, Gravity.CENTER);
		this.homeFragment = homeFragment;
	}

	@Override
	public void setContentView() {
		homeSignTaskView = HomeSignTaskView_.build(baseActivity);
		homeSignTaskView.setBaseDialog(this);
//		homeSignTaskView.setiHomeSignTaskView(homeFragment);
		setContentView(homeSignTaskView);
	}

	public void setDataJsonObject(JSONObject dataJsonObject) {
		if (homeSignTaskView != null) {
			homeSignTaskView.loadData(dataJsonObject);
		}
	}

	@Override
	public void initBaseDialog() {
		super.initBaseDialog();
		setCancelable(false);
	}

	/**
	 * 关闭对话框
	 */
	public void cancelDialog() {
//		homeFragment.openHomeAnswerTaskDialog();
		cancel();
	}

}
